package com.chag.app.biz.dao.gen;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface PositionTypeMapper {
    int countByExample(PositionTypeCriteria example);

    int deleteByExample(PositionTypeCriteria example);

    @Delete({
        "delete from z_positiontype",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into z_positiontype (id, pos_type_dec, ",
        "pos_type_name, pid)",
        "values (#{id,jdbcType=INTEGER}, #{posTypeDec,jdbcType=VARCHAR}, ",
        "#{posTypeName,jdbcType=VARCHAR}, #{pid,jdbcType=INTEGER})"
    })
    int insert(PositionType record);

    int insertSelective(PositionType record);

    List<PositionType> selectByExample(PositionTypeCriteria example);

    @Select({
        "select",
        "id, pos_type_dec, pos_type_name, pid",
        "from z_positiontype",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    PositionType selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") PositionType record, @Param("example") PositionTypeCriteria example);

    int updateByExample(@Param("record") PositionType record, @Param("example") PositionTypeCriteria example);

    int updateByPrimaryKeySelective(PositionType record);

    @Update({
        "update z_positiontype",
        "set pos_type_dec = #{posTypeDec,jdbcType=VARCHAR},",
          "pos_type_name = #{posTypeName,jdbcType=VARCHAR},",
          "pid = #{pid,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PositionType record);
}